using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using CMSAR.Services;
using CMSAR.Domain;
namespace CMSAR.Controllers
{
    public class PageController : Controller
    {
        private IRepository<Page> _pageRepository = null;
        public PageController(IRepository<Page> pageRepository)
        {
            _pageRepository = pageRepository;
        }

        //
        // GET: /Index/

        public ActionResult Index(int pageId)
        {
            this.ViewData.Model = _pageRepository.Get(pageId);
            return View();
        }
        public ActionResult Index(string url)
        {
            this.ViewData.Model = _pageRepository.Get(url);
            return View();
        }



    }
}
